<?
class Blog extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();

		$this->load->model('user_model');
	}

	public function index()
	{
		if($_POST) {
			$this->user_model->register(array(
				'user_name' => $this->input->post('user_name'),
				'user_email' => $this->input->post('user_email'),
				'user_password' => sha1($this->config->item('auth_pass_salt1').$this->input->post('user_password').$this->config->item('auth_pass_salt2')),
				'fk_role_id' => $this->input->post('user_role')
			));
		}
		$data['page'] = 'pages/register';
		$this->load->view('index', $data);
	}

	public function comments()
	{
		echo 'Look at this!';
	}
}
